<template>
  <view class="">
    <u-button @click="openIndex">首页tabbar页面</u-button>
    <view class="" v-for="(item,index) in subPackages" :key="index">
      <view class="">
        {{item.root}}
      </view>
      <view class="" v-for="(ele,dInde) in item.pages" :key="dInde">

        <u-button @click="open(item, ele)">{{dInde+1}}
          {{ele.style.navigationBarTitleText || item.root+'/'+ele.path}}</u-button>
      </view>
    </view>
  </view>
</template>

<script setup>
  import {
    pages,
    subPackages
  } from '@/pages.json'
  console.log(subPackages, 'subPackages');
  const open = (item, ele) => {

    uni.navigateTo({
      url: `/${item.root}/${ele.path}`
    })
  }
  const openIndex = () => {
    uni.navigateTo({
      url: '/pages/index/index'
    })
  }
</script>

<style>
</style>